#include "manano_common.h"

#include "mdtx-online/indicator/indicator_type_s4_kurtosis.h"
namespace indi = mdtx::online::indicator;

using rollkurt_G2 = unary4<indi::rollkurt_G2>;
using rollkurt_G2cu = unary4<indi::rollkurt_G2cu>;
using rollkurt_quantile = unary4<indi::rollkurt_quantile>;

void bind_indi_s4_kurtosis(py::module &m)
{
    auto mod = m.def_submodule("kurtosis", "Rolling kurtosis");
    {
        auto v = py::class_<rollkurt_G2>(mod, "G2")
                     .def(py::init<int>(), py::arg("period"))
                     .def("run", &rollkurt_G2::run, py::arg("x"),
                     R"mydoc(
                        Run calculation
                        Args:
                           x (float64) : input data
                        Return:
                           mean (float64)
                           SD (fload64)
                           skewness (float64),
                           kurtosis (float64))mydoc")
                     .def("run", &rollkurt_G2::run2, py::arg("x"),
                     R"mydoc(
                        Run calculation
                        Args:
                           x (numpy.array) : input data
                        Return:
                           mean (numpy.array)
                           SD (numpy.array)
                           skewness (numpy.array),
                           kurtosis (numpy.array))mydoc");
        v.doc() = R"mydoc(
                    Rolling kurtosis, G2 coefficient
                    Args:
                        period (int) : rolling window period)mydoc";
    }
    {
        auto v = py::class_<rollkurt_G2cu>(mod, "G2cu")
                     .def(py::init())
                     .def("run", &rollkurt_G2cu::run, py::arg("x"),
                     R"mydoc(Run calculation
                             Args:
                                x (float64) : input data
                             Return:
                                mean (float64)
                                SD (fload64)
                                skewness (float64),
                                kurtosis (float64))mydoc")
                     .def("run", &rollkurt_G2cu::run2, py::arg("x"),
                     R"mydoc(Run calculation
                             Args:
                                x (numpy.array) : input data
                             Return:
                                mean (numpy.array)
                                SD (numpy.array)
                                skewness (numpy.array),
                                kurtosis (numpy.array))mydoc");
        v.doc() = R"mydoc(
                    Cumulative kurtosis, G2 coefficient
                    Args:
                        period (int) : rolling window period)mydoc";
    }
    {
        auto v = py::class_<rollkurt_quantile>(mod, "quantile")
                     .def(py::init<int>(), py::arg("period"))
                     .def("run", &rollkurt_quantile::run, py::arg("x"),
                     R"mydoc(
                        Run calculation
                        Args:
                           x (float64) : input data
                        Return:
                           mean (float64)
                           SD (fload64)
                           skewness (float64),
                           kurtosis (float64))mydoc")
                     .def("run", &rollkurt_quantile::run2, py::arg("x"),
                     R"mydoc(
                        Run calculation
                        Args:
                           x (numpy.array) : input data
                        Return:
                           mean (numpy.array)
                           SD (numpy.array)
                           skewness (numpy.array),
                           kurtosis (numpy.array))mydoc");
        v.doc() = R"mydoc(
                    Rolling kurtosis, quantile based, Moors' interpretation
                    Args:
                        period (int) : rolling window period)mydoc";
    }
}
